/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package legadee2petri;

import org.w3c.dom.Element;
import org.w3c.dom.Node;

/**
 *
 * @author Fabricio
 */
class GameScenario {
    private int PaletteX, PaletteY, PaletteWidth, PaletteHeight, PaletteIndex;
    private boolean PaletteShow;
    private int PaletteEduFunSeperatorX, PaletteViewedMScenarioItemID;
    private int PaletteViewedLevel;
    private int PaletteMainCanvasXScroolPosition, PaletteMainCanvasYScroolPosition;
    private Modules modules;

    void initialize(Node item) {
        Element ele = (Element) item;
        PaletteX = Integer.parseInt(ele.getElementsByTagName("PaletteX").item(0).getTextContent());
        PaletteY  = Integer.parseInt(ele.getElementsByTagName("PaletteY").item(0).getTextContent());
        PaletteWidth  = Integer.parseInt(ele.getElementsByTagName("PaletteWidth").item(0).getTextContent());
        PaletteHeight  = Integer.parseInt(ele.getElementsByTagName("PaletteHeight").item(0).getTextContent());
        PaletteIndex  = Integer.parseInt(ele.getElementsByTagName("PaletteIndex").item(0).getTextContent());
        PaletteShow  = Boolean.parseBoolean(ele.getElementsByTagName("PaletteShow").item(0).getTextContent());
        PaletteEduFunSeperatorX  = Integer.parseInt(ele.getElementsByTagName("PaletteEduFunSeperatorX").item(0).getTextContent());
        PaletteViewedMScenarioItemID  = Integer.parseInt(ele.getElementsByTagName("PaletteViewedMScenarioItemID").item(0).getTextContent());
        PaletteViewedLevel  = Integer.parseInt(ele.getElementsByTagName("PaletteViewedLevel").item(0).getTextContent());
        PaletteMainCanvasXScroolPosition  = Integer.parseInt(ele.getElementsByTagName("PaletteMainCanvasXScroolPosition").item(0).getTextContent());
        PaletteMainCanvasYScroolPosition  = Integer.parseInt(ele.getElementsByTagName("PaletteMainCanvasYScroolPosition").item(0).getTextContent());
        modules.initialize(ele.getElementsByTagName("modules").item(0));
    }

}
